using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
using pdf_extract_image;

namespace cmd_pdf_extract_image
{
    class Program
    {
        static void Main(string[] args)
        {
            var di = new DirectoryInfo(@"C:\Users\ghanique\Dropbox\ScansNN\ConvertFromPDF");
            var files = di.GetFiles("*.pdf");

            var i = 0;
            foreach (var file in files)
            {
                var images = PdfExtracter.ExtractImages(file);
                foreach (var image in images)
                {
                    string filename = @"C:\Users\ghanique\Dropbox\ScansNN\ConvertFromPDF\" + i++ + ".jpg";
                    image.Save(filename, ImageFormat.Png);
                }
            }
        }
    }
}
